Optimal. Leaf size=44 \[ \frac{a (B+i A) \log (\sin (c+d x))}{d}-a x (A-i B)-\frac{a A \cot (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0840953, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.094, Rules used = {3591, 3531, 3475} \[ \frac{a (B+i A) \log (\sin (c+d x))}{d}-a x (A-i B)-\frac{a A \cot (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3591
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=-\frac{a A \cot (c+d x)}{d}+\int \cot (c+d x) (a (i A+B)-a (A-i B) \tan (c+d x)) \, dx\\ &=-a (A-i B) x-\frac{a A \cot (c+d x)}{d}+(a (i A+B)) \int \cot (c+d x) \, dx\\ &=-a (A-i B) x-\frac{a A \cot (c+d x)}{d}+\frac{a (i A+B) \log (\sin (c+d x))}{d}\\ \end{align*}
Mathematica [C] time = 0.197743, size = 84, normalized size = 1.91 \[ -\frac{a A \cot (c+d x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(c+d x)\right )}{d}+\frac{i a A (\log (\tan (c+d x))+\log (\cos (c+d x)))}{d}+\frac{a B (\log (\tan (c+d x))+\log (\cos (c+d x)))}{d}+i a B x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 71, normalized size = 1.6 \begin{align*} iBax+{\frac{iAa\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-Axa+{\frac{iBac}{d}}-{\frac{Aa\cot \left ( dx+c \right ) }{d}}-{\frac{Aac}{d}}+{\frac{aB\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.66823, size = 86, normalized size = 1.95 \begin{align*} -\frac{2 \,{\left (d x + c\right )}{\left (A - i \, B\right )} a +{\left (i \, A + B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \,{\left (i \, A + B\right )} a \log \left (\tan \left (d x + c\right )\right ) + \frac{2 \, A a}{\tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.38598, size = 162, normalized size = 3.68 \begin{align*} \frac{-2 i \, A a +{\left ({\left (i \, A + B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (-i \, A - B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} - d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.39197, size = 58, normalized size = 1.32 \begin{align*} - \frac{2 i A a e^{- 2 i c}}{d \left (e^{2 i d x} - e^{- 2 i c}\right )} + \frac{a \left (i A + B\right ) \log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.4037, size = 142, normalized size = 3.23 \begin{align*} \frac{A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 4 \,{\left (-i \, A a - B a\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) + 2 \,{\left (i \, A a + B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + \frac{-2 i \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - A a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]